{% extends "main.html" %}
{% load common %}

{% block title %}Patchman Dashboard{% endblock %}

{% block content_title %}{{ site.name }} Patch Management Dashboard{% endblock %}

{% block breadcrumbs %}<a href="/">Home</a>{% endblock %}

{% block content %}
<div id="content-main">
{% with lonely_oses.count as count %}
  {% if lonely_oses.count > 0 %}
  <div class="module">
    <div class="resultslink" id="r1"><a href="#">{{ count }} Operating Systems are not linked to any OS Group</a></div>
      <div class="results" id="r1">
        {% gen_table lonely_oses %}
      </div>
  </div>
  {% endif %}
{% endwith %}
<div id="content-main">
{% with nohost_oses.count as count %}
  {% if nohost_oses.count > 0 %}
  <div class="module">
    <div class="resultslink" id="r3"><a href="#">{{ count }} Operating Systems are not installed on any Host</a></div>
      <div class="results" id="r3">
        {% gen_table nohost_oses %}
      </div>
  </div>
  {% endif %}
{% endwith %}
{% with norepo_osgroups.count as count %}
  {% if count > 0 and norepo_osgroups != None %}
  <div class="module">
    <div class="resultslink" id="r5"><a href="#">{{ count }} OS Groups have no repositories</a></div>
      <div class="results" id="r5">
        {% gen_table norepo_osgroups %}
      </div>
  </div>
  {% endif %}
{% endwith %}
{% with stale_hosts.count as count %}
  {% if count > 0 %}
  <div class="module">
    <div class="resultslink" id="r7"><a href="#">{{ count }} Hosts have not reported in 2 weeks</a></div>
      <div class="results" id="r7">
        {% gen_table stale_hosts %}
      </div>
  </div>
  {% endif %}
{% endwith %}
{% with reboot_hosts.count as count %}
  {% if count > 0 %}
  <div class="module">
    <div class="resultslink" id="r9"><a href="#">{{ count }} Hosts require a reboot for security reasons (e.g. kernel update)</a></div>
      <div class="results" id="r9">
        {% gen_table reboot_hosts %}
      </div>
  </div>
  {% endif %}
{% endwith %}
{% with secupdate_hosts.count as count %}
  {% if count > 0 %}
  <div class="module">
    <div class="resultslink" id="r11"><a href="#">{{ count }} Hosts have security updates pending</a></div>
      <div class="results" id="r11">
        {% gen_table secupdate_hosts %}
      </div>
  </div>
  {% endif %}
{% endwith %}
{% with update_hosts.count as count %}
  {% if count > 0 %}
  <div class="module">
    <div class="resultslink" id="r13"><a href="#">{{ count }} Hosts have bugfix-only updates pending</a></div>
      <div class="results" id="r13">
        {% gen_table update_hosts %}
      </div>
  </div>
  {% endif %}
{% endwith %}
{% with norepo_hosts.count as count %}
  {% if count > 0 %}
  <div class="module">
    <div class="resultslink" id="r15"><a href="#">{{ count }} Hosts have no associated repositories</a></div>
      <div class="results" id="r15">
        {% gen_table norepo_hosts %}
      </div>
  </div>
  {% endif %}
{% endwith %}
{% with diff_rdns_hosts.count as count %}
  {% if count > 0 %}
  <div class="module">
    <div class="resultslink" id="r16"><a href="#">{{ count }} Hosts a different rDNS entry (and have rDNS checking enabled)</a></div>
      <div class="results" id="r16">
        {% gen_table diff_rdns_hosts %}
      </div>
  </div>
  {% endif %}
{% endwith %}
{% with failed_mirrors.count as count %}
  {% if count > 0 %}
  <div class="module">
    <div class="resultslink" id="r17"><a href="#">{{ count }} Repositories have some mirrors that are failing</a></div>
      <div class="results" id="r17">
        {% gen_table failed_mirrors %}
      </div>
  </div>
  {% endif %}
{% endwith %}
{% with disabled_mirrors.count as count %}
  {% if count > 0 %}
  <div class="module">
    <div class="resultslink" id="r19"><a href="#">{{ count }} Repositories have some mirrors that are disabled</a></div>
      <div class="results" id="r19">
        {% gen_table disabled_mirrors %}
      </div>
  </div>
  {% endif %}
{% endwith %}
{% with norefresh_mirrors.count as count %}
  {% if count > 0 %}
  <div class="module">
    <div class="resultslink" id="r21"><a href="#">{{ count }} Repositories have some mirrors that are not set to refresh (possibly failed too many times)</a></div>
      <div class="results" id="r21">
        {% gen_table norefresh_mirrors %}
      </div>
  </div>
  {% endif %}
{% endwith %}
{% with failed_repos.count as count %}
  {% if count > 0 %}
  <div class="module">
    <div class="resultslink" id="r23"><a href="#">{{ count }} Repositories where all mirrors are failing</a></div>
      <div class="results" id="r23">
        {% gen_table failed_repos %}
      </div>
  </div>
  {% endif %}
{% endwith %}
{% with unused_repos.count as count %}
  {% if count > 0 %}
  <div class="module">
    <div class="resultslink" id="r25"><a href="#">{{ count }} Repositories are unused (no associated hosts or os groups)</a></div>
      <div class="results" id="r25">
        {% gen_table unused_repos %}
      </div>
  </div>
  {% endif %}
{% endwith %}
{% with nomirror_repos.count as count %}
  {% if count > 0 %}
  <div class="module">
    <div class="resultslink" id="r27"><a href="#">{{ count }} Repositories have no mirrors</a></div>
      <div class="results" id="r27">
        {% gen_table nomirror_repos %}
      </div>
  </div>
  {% endif %}
{% endwith %}
{% with nohost_repos.count as count %}
  {% if count > 0 %}
  <div class="module">
    <div class="resultslink" id="r29"><a href="#">{{ count }} Repositories are not used by any hosts</a></div>
      <div class="results" id="r29">
        {% gen_table nohost_repos %}
      </div>
  </div>
  {% endif %}
{% endwith %}
{% with possible_mirrors|length as count %}
  {% if count > 0 %}
  <div class="module">
    <div class="resultslink" id="r31"><a href="#">{{ count }} Sets of mirrors have the same checksum and are not linked</a></div>
      <div class="results" id="r31">
        {% for checksum in possible_mirrors %}
        <div class="brick" style="{% cycle 'background:#bfdddd' 'background:#deeeee' %}">
        <a class="dark" href="repos/mirrors/?checksum={{ checksum }}">{{ checksum }}</a></div>
        {% endfor %}
        <div class="clearbrick"></div>
      </div>
  </div>
  {% endif %}
{% endwith %}
{% with norepo_packages.count as count %}
  {% if count > 0 %}
  <div class="module">
    <div class="resultslink" id="r33"><a href="#">{{ count }} Installed Packages are not from any repository</a></div>
      <div class="results" id="r33">
        {% for package in norepo_packages %}
        <div class="brick" style="{% cycle 'background:#bfdddd' 'background:#deeeee' %}">
        <a class="dark" href="{{ package.get_absolute_url }}">{{ package }}</a></div>
        {% endfor %}
        <div class="clearbrick"></div>
     </div>
  </div>
  {% endif %}
{% endwith %}
{% with orphaned_packages.count as count %}
  {% if count > 0 %}
  <div class="module">
    <div class="resultslink" id="r35"><a href="#">{{ count }} Packages are orphaned (not from any repo, not installed anywhere)</a></div>
      <div class="results" id="r35">
        {% for package in orphaned_packages %}
        <div class="brick" style="{% cycle 'background:#bfdddd' 'background:#deeeee' %}">
        <a class="dark" href="{{ package.get_absolute_url }}">{{ package }}</a></div>
        {% endfor %}
        <div class="clearbrick"></div>
     </div>
  </div>
  {% endif %}
{% endwith %}
{% with unprocessed_reports.count as count %}
  {% if count > 0 %}
  <div class="module">
    <div class="resultslink" id="r37"><a href="#">{{ count }} Reports have not yet been processed</a></div>
      <div class="results" id="r37">
        {% gen_table unprocessed_reports %}
     </div>
  </div>
  {% endif %}
{% endwith %}
</div>
{% endblock %}
